package com.netblizzard.nms.util.database;

import java.sql.Connection;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public abstract class CommonDBO implements Cloneable {
	protected static final Log logger = LogFactory.getLog(CommonDBO.class);
	
	protected String serverAddr = "";
	protected String serverPort = "";
	protected String userName = "";
	protected String password = "";
	protected Connection jdbcConn = null;

	public static final int DB_TYPE_ORACLE = 0;
	public static final int DB_TYPE_MYSQL = 1;
	public static final int DB_TYPE_SQLSERVER = 2;
	protected int dbType;

	@Override
	public Object clone() throws CloneNotSupportedException {
		return super.clone();
	}

	public abstract boolean connect();

	public String getServerAddr() {
		return serverAddr;
	}

	public void setServerAddr(String serverAddr) {
		this.serverAddr = serverAddr;
	}

	public String getServerPort() {
		return serverPort;
	}

	public void setServerPort(String serverPort) {
		this.serverPort = serverPort;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Connection getJdbcConn() {
		return jdbcConn;
	}

	public void setJdbcConn(Connection jdbcConn) {
		this.jdbcConn = jdbcConn;
	}

}
